package com.th.therp.pojo.emtity;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Customer {
    private Integer id;

    @NotBlank(message = "请输入名称")
    @Length(message = "名称的长度必须在 {min} 到 {max} 个字符之间", min = 1, max = 20)
    private String name;

    private String contact;

    @NotBlank(message = "请输入电话")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入有效的手机号") // 验证手机号格式
    private String phone;

    @NotBlank(message = "请输入邮箱")
    @Email(message = "请输入有效的邮箱地址") // 验证邮箱格式
    private String email;

    private Integer isDeleted;
}
